#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>

int judge(int a, int b, int c, int d)
{
    if (a * a + b * b + c * c == d * d)
        return 1;
    return 0;
}

int main()
{
    int m, n;
    scanf("%d,%d", &m, &n);
    if (m > n)
        printf("Invalid Data\n");
    else {
        int find = 0;
        for (int i = m; i <= n; i++)
        {
            for (int j = i; j <= n; j++)
            {
                for (int k = j; k <= n; k++)
                {
                    for (int h = k; h <= n; h++)
                    {
                        if (judge(i, j, k, h))
                        {
                            find = 1;
                            printf("(%d, %d, %d, %d)\n", i, j, k, h);
                        }

                    }
                }
            }
        }
        if (!find)
            printf("None\n");
    }
    return 0;
}